package cn.huyanbing.visual.spring.research.ocr;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @BelongProject middleware
 * @BelongPackage cn.huyanbing.visual.spring.research.ocr
 * @Description TODO
 * @ClassName InfoExtractor
 * @Author huyangbing
 * @Date 2025/1/13 09:51
 * @Version 1.0.0
 */
public class InfoExtractor {


    public String extractIDNumber(String text) {
        Pattern pattern = Pattern.compile("[0-9]{18}|[0-9]{15}");
        Matcher matcher = pattern.matcher(text);

        if (matcher.find()) {
            return matcher.group();
        }

        return null;
    }
}
